package com.hejielife.producerconsumer3;

/**
 * 2019年8月2日 下午2:20:43
 * 
 * @author hejielife
 * @despribe ClearThread 清理者
 */
public class ClearThread extends Thread {
	private final Table table;

	public ClearThread(String name, Table table) {
		super(name);
		this.table = table;
	}

	public void run() {
		try {
			while (true) {
				Thread.sleep(5000);
				System.out.println("===== " + getName() + " clears =====");
				table.clear();
			}
		} catch (InterruptedException e) {
		}
	}
}
